package org.nkywz.android.magiccube;

import javax.microedition.khronos.opengles.GL10;

public class MagicCube {

	private Cube[] mCubes;

	public MagicCube() {
		mCubes = new Cube[26];
		mCubes[0] = new Cube(-1, -1, -1);
		mCubes[1] = new Cube(-1, -1, 0);
		mCubes[2] = new Cube(-1, -1, 1);
		mCubes[3] = new Cube(-1, 0, -1);
		mCubes[4] = new Cube(-1, 0, 0);
		mCubes[5] = new Cube(-1, 0, 1);
		mCubes[6] = new Cube(-1, 1, -1);
		mCubes[7] = new Cube(-1, 1, 0);
		mCubes[8] = new Cube(-1, 1, 1);
		mCubes[9] = new Cube(0, -1, -1);
		mCubes[10] = new Cube(0, -1, 0);
		mCubes[11] = new Cube(0, -1, 1);
		mCubes[12] = new Cube(0, 0, -1);
		mCubes[13] = new Cube(0, 0, 1);
		mCubes[14] = new Cube(0, 1, -1);
		mCubes[15] = new Cube(0, 1, 0);
		mCubes[16] = new Cube(0, 1, 1);
		mCubes[17] = new Cube(1, -1, -1);
		mCubes[18] = new Cube(1, -1, 0);
		mCubes[19] = new Cube(1, -1, 1);
		mCubes[20] = new Cube(1, 0, -1);
		mCubes[21] = new Cube(1, 0, 0);
		mCubes[22] = new Cube(1, 0, 1);
		mCubes[23] = new Cube(1, 1, -1);
		mCubes[24] = new Cube(1, 1, 0);
		mCubes[25] = new Cube(1, 1, 1);
	}

	public void draw(GL10 gl) {
		gl.glFrontFace(GL10.GL_CW);

		for (int i = 0; i < mCubes.length; i++) {
			mCubes[i].draw(gl);
		}
	}
}
